/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.fasepa.sgpf.dao;

import br.gov.fasepa.sgpf.entity.Estado;
import br.gov.fasepa.sgpf.factoryDAO.GenericDAO;
import javax.persistence.Query;

/**
 *
 * @author marcosdj
 */
public class EstadoDAO extends GenericDAO<Estado> {

    public Estado obter(String UF) {
        String query = "Estado.findByUf";
        final Query q = getEntityManager().createNamedQuery(query).
                setParameter("uf", UF);
        try {
            return (Estado) q.getSingleResult();
        } catch (Exception e) {
            return null;
        }
    }

}
